<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/11/22,0022
  Time: 9:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>歌曲管理</title>
</head>
<body>
    <h1>欢迎您:${admin.username}</h1>
    <a href="/FindSingerController">添加</a>
    <table border="1px black" width="600">
        <tr>
            <td>歌名</td>
            <td>歌手</td>
            <td>专辑</td>
            <td>操作</td>
        </tr>
        <c:forEach var="list" items="${pageBean.list}">
            <tr>
                <td>${list.name}</td>
                <td>${list.singer.sname}</td>
                <td>${list.album}</td>
                <td><a href="/DeleteMusicController?mid=${list.mid}">删除</a> | <a href="/FindOneMusicController?mid=${list.mid}">修改</a></td>
            </tr>
        </c:forEach>
    <tr>
        <td colspan="8">
            <%--1.判断是否显示上一页--%>
            <c:if test="${pageBean.currentPage!=1}">
                <a href="/FindAllMusicController?currentPage=${pageBean.lastPage}">
                    上一页
                </a>
            </c:if>
            <%--2.显示导航的页码数字--%>
            <c:forEach begin="${pageBean.firstPage}" end="${pageBean.endPage}" var="page">
                <a href="/FindAllMusicController?currentPage=${page}">
                        ${page}  &nbsp;
                </a>
            </c:forEach>
            <%--3.判断是否显示下一页--%>
            <c:if test="${pageBean.currentPage!=pageBean.totalPage}">
                <a href="/FindAllMusicController?currentPage=${pageBean.nextPage}">
                    下一页
                </a>
            </c:if>
        </td>
    </tr>
    </table>
    <a href="/AdminLogoutController">退出</a>
</body>
</html>
